package br.com.pontov.pieces;

public class Vector2D {
	
	private float x;
	private float y;
	
	public Vector2D(float i, float j) {
		x = i;
		y = j;
	}

	public float getX() {
		return x;
	}
	
	public void setX(float x) {
		this.x = x;
	}
	
	public float getY() {
		return y;
	}
	
	public void setY(float y) {
		this.y = y;
	}

	public Vector2D multiply(float speed) {
		x*=speed;
		y*=speed;		
		return this;
	}

	public Vector2D plusMe(Vector2D plus) {
		this.x += plus.getX();
		this.y += plus.getY();
		return this;
	}
	
	public Vector2D minus(Vector2D other) {
		x -= other.x;
		y -= other.y;
		return this;
	}


	public float dot(Vector2D n) {
		
		return x * n.getX() + y * n.getY();
	}

}
